package cn.edu.scau.cmi.hexiaoqing.interProgramming;

import java.util.HashSet;
import java.util.Set;

public class Multiton {

	private String name;
	private static Set<Multiton> instances = new HashSet<Multiton>();

	private Multiton(String name) {
		this.name = name;
	}

	public static Set<Multiton> addInstances(String name) {
		if (instances.size() < 5) {
			Multiton instance = new Multiton(name);
			instances.add(instance);
		}
		return instances;
	}

	public static Set<Multiton> getInstances() {
		return instances;
	}

	public String getName() {
		return name;
	}
}
